package main 

import (
	"fmt"
)
//defer 延时
func sum(n1 int,n2 int)int{

	//进入栈中 数据一同拷贝
	defer fmt.Println("1 n1=",n1)
	defer fmt.Println("2 n2=",n2)

	n1++
	n2++
	res:=n1+n2
	fmt.Println("3 res=",res)
	return res

}
func main(){

	//调用时，3 res先执行，后从defer栈取出执行
	res:=sum(100,200)
	fmt.Println("main res=",res)
}